function A_star = find_A_star(tau_q,tau_e,alpha,T,lambda,phi,y_high,y_low,p)
    % find A star before shock
    A = 0;
    A_star = zeros(1,T-1);
    while min(A_star)==0
        A = A + 1e-4;
        S = surplus(tau_q,tau_e,A,alpha);
        [value,policy] = solve_bellman(S,T,lambda,phi,y_high,y_low,p);
        policy_low_income = squeeze(policy(2,1,:));
        for t=1:T-1
            if A_star(t) == 0 && policy_low_income(t) == 1
                A_star(t) = A;
            end     
        end
    end
end